package com.lk.ii.service.impl;

import java.util.List;
import com.lk.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lk.ii.mapper.IiRecommendMaterialMapper;
import com.lk.ii.domain.IiRecommendMaterial;
import com.lk.ii.service.IIiRecommendMaterialService;
import com.lk.common.core.text.Convert;

/**
 * 推荐位详情Service业务层处理
 * 
 * @author lk
 * @date 2021-02-05
 */
@Service
public class IiRecommendMaterialServiceImpl implements IIiRecommendMaterialService 
{
    @Autowired
    private IiRecommendMaterialMapper iiRecommendMaterialMapper;

    public List<IiRecommendMaterial> getIiRecommendMaterialList(Long recommendId){
        return iiRecommendMaterialMapper.getIiRecommendMaterialList(recommendId);
    };

    /**
     * 查询推荐位详情
     * 
     * @param id 推荐位详情ID
     * @return 推荐位详情
     */
    @Override
    public IiRecommendMaterial selectIiRecommendMaterialById(Long id)
    {
        return iiRecommendMaterialMapper.selectIiRecommendMaterialById(id);
    }

    /**
     * 查询推荐位详情列表
     * 
     * @param iiRecommendMaterial 推荐位详情
     * @return 推荐位详情
     */
    @Override
    public List<IiRecommendMaterial> selectIiRecommendMaterialList(IiRecommendMaterial iiRecommendMaterial)
    {
        return iiRecommendMaterialMapper.selectIiRecommendMaterialList(iiRecommendMaterial);
    }

    /**
     * 新增推荐位详情
     * 
     * @param iiRecommendMaterial 推荐位详情
     * @return 结果
     */
    @Override
    public int insertIiRecommendMaterial(IiRecommendMaterial iiRecommendMaterial)
    {
        iiRecommendMaterial.setCreateTime(DateUtils.getNowDate());
        return iiRecommendMaterialMapper.insertIiRecommendMaterial(iiRecommendMaterial);
    }

    /**
     * 修改推荐位详情
     * 
     * @param iiRecommendMaterial 推荐位详情
     * @return 结果
     */
    @Override
    public int updateIiRecommendMaterial(IiRecommendMaterial iiRecommendMaterial)
    {
        iiRecommendMaterial.setUpdateTime(DateUtils.getNowDate());
        return iiRecommendMaterialMapper.updateIiRecommendMaterial(iiRecommendMaterial);
    }

    /**
     * 删除推荐位详情对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteIiRecommendMaterialByIds(String ids)
    {
        return iiRecommendMaterialMapper.deleteIiRecommendMaterialByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除推荐位详情信息
     * 
     * @param id 推荐位详情ID
     * @return 结果
     */
    @Override
    public int deleteIiRecommendMaterialById(Long id)
    {
        return iiRecommendMaterialMapper.deleteIiRecommendMaterialById(id);
    }
}
